package cn.easybuy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import cn.easybuy.entity.Product;

@Repository
public interface ProductMapper {
	public int addProduct(Product p);
	public int updateProduct(Product p);
	public int deleteProduct(Integer id);
	public List<Product> getProductListByName_level(@Param("currentPageNo")Integer currentPageNo,@Param("pageSize")Integer pageSize,@Param("proName")String proName,@Param("categoryId")Integer categoryId);
	public int getProductCount(@Param("proName")String proName,@Param("categoryId")Integer categoryId);
	public Product getProductById(Integer id);
	public int updateStock(@Param("id")Integer id, @Param("quantity")Integer quantity);
}
